home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.9 KB | 90 lines | [TEXT/GEOL] |
- Item 6003814 9-Nov-89 11:11
-
- From: D2086 Efficient Field Svc, C Faith,PRT
-
- To: D1950 CSG, Don Phillips,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Dim Highlight Update
-
- George,
-
- The last Dim code I gave you did not work for updates when the fromHL was
- hlOFF and toHL was hlDim.
-
- This works for all 9 possibilities.
-
- PROCEDURE TMyGridView.HighlightCells(theCells: RgnHandle; fromHL, toHL:
- HLState); OVERRIDE;
-
- PROCEDURE DoDrawCell(aCell: GridCell);
- VAR
- aRect: VRect;
- aQDRect:Rect;
-
- BEGIN
- CellToVRect(aCell,aRect);
- ViewToQDRect(aRect,aQDRect);
- InsetRect(aQDRect,fColInset,fRowInset);
- DrawCell(aCell,aQDRect);
- END;
-
- BEGIN
- IF (fromHL <> toHL) THEN
- BEGIN
- CellsToPixels(theCells, pPixelsToHighlight);
- IF Focus THEN
- BEGIN
- IF fromHL = hlON THEN
- BEGIN
- IF toHL = hlOFF THEN
- BEGIN
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
- END
- ELSE IF toHL = hlDim THEN
- BEGIN
- PenPat(gray);
- PenMode(patBic);
- PaintRgn(pPixelsToHighlight); { dim the cells }
- END;
- END { fromHL is hlON }
- ELSE IF fromHL = hlDim THEN
- BEGIN
- PenPat(white);
- PenMode(patCopy);
- PaintRgn(pPixelsToHighlight); { blank out the cells }
-
- EachSelectedCellDo(DoDrawCell); { redraw the cells }
-
- IF toHL = hlON THEN
- BEGIN
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
- END;
- END { fromHL is hlDim }
- ELSE
- BEGIN { fromHL is hlOFF }
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
-
- IF toHL = hlDim THEN
- BEGIN
- PenPat(gray);
- PenMode(patBic);
- PaintRgn(pPixelsToHighlight); { dim the cells }
- END;
- END; { fromHL is hlOFF }
- END; { IF Focus }
- END;
- END;
-
- Yours,
-
- Curtis
-
-